﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using NeuralNetworks.Layers;
using NeuralNetworks.Neurons;

namespace NeuralNetworks.FileParsing
{
    class ConnectionWeight : LayerPart
    {
        private int currentLayerNeuron, nextLayerNeuron;
        private double w;

        public ConnectionWeight(int current, int next, double w)
        {
            this.currentLayerNeuron = current;
            this.nextLayerNeuron = next;
            this.w = w;
        }

        public void apply(Layer current, Layer next)
        {
            if (next != null)
            {
                Console.WriteLine("connection w " + current.ToString() + ":" + currentLayerNeuron + "->" + next.ToString() + ":" + nextLayerNeuron);
                ((Connection)((Neuron)next.Neurons[nextLayerNeuron]).Inputs[currentLayerNeuron]).Weight = w;
            }
        }
    }
}
